<?php

return array(

	'defaultController' => "home",
	
	// preloading 'log' component
	'preload'=>array('log'),
  	// autoloading model and component classes
  
	'import'=>array(
		'application.extensions.*',
		'application.models.*',
	),
 
	
	'components'=>array(
	
		// component db
		'db'=>array(
			'class'=>'CDbConnection',
			'connectionString'=>'mysql:host='.HOST_NAME.';dbname='.DB_NAME,
			'username'=>USER_NAME,
			'password'=>PASS_WORD,
			'emulatePrepare'=>true, // needed by some MySQL installations
		),
		

		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName' => false,
			
			'rules'=>array(
			
				'test' => 'test',
				
				'search' => 'search',
				
				'home/advancedsearch' => 'home/advancedsearch',
				
				// quan ly noi dung 
				'tin-tuc' => 'tintuc',
				'tin-tuc/' => 'tintuc',
				
				'tin-tuc/<alias>' => 'tintuc/chitiet/alias/<alias>',
				
				// San pham
				'bat-dong-san/<alias>' => 'product/chitiet/alias/<alias>',
				
				//Mac dinh khi chon dich vu
				'<alias>'=>'search/dichvu/alias/<alias>',
				'<alias>/'=>'search/dichvu/alias/<alias>',
				
				// Filter danh muc BDS
				'<alias>/dm/<filter>' => 
					'search/dm/alias/<alias>/filter/<filter>',
				'<alias>/dm/<filter>/' => 
					'search/dm/alias/<alias>/filter/<filter>',
				
				// Filter Quan
				'<alias>/quan/<filter>/' => 
					'search/quan/alias/<alias>/filter/<filter>',
				
				// Filter Gia
				'<alias>/gia/<filter>/' => 
					'search/gia/alias/<alias>/filter/<filter>',
				
				//Filter Dien tich
				'<alias>/dien-tich/<filter>/' => 
					'search/dientich/alias/<alias>/filter/<filter>',
				
				'<category>/<article>'=>'baiviet/view/alias/<article>',
			),
		),
	),
);
